/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.order.repository;

import iaas.repository.BaseRepository;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.wealth.order.entity.OrderPlat;

/**
 * @author chan
 * @version 1.0
 * @since 1.0
 */
 
@Repository
public interface OrderPlatDao extends BaseRepository<OrderPlat, Long> ,JpaSpecificationExecutor<OrderPlat>{
	
	public List<OrderPlat> findByCorpIdAndMemberIdAndPaystatusAndCreateTimeGreaterThanEqual(Long corpid,Long memberid,Integer paystatus,Date createTime);
	
	public List<OrderPlat> findByCorpIdAndMemberIdAndPaystatusAndCreateTimeGreaterThanEqualOrderByCreateTimeDesc(Long corpid,Long memberid,Integer paystatus,Date createTime);
	
	//wap 任务调度 查询订单未支付方法
	@Query(value="SELECT * FROM t_order_plat WHERE DATEDIFF(create_time,NOW())=0 AND paystatus=?1  AND STATUS = ?2 ",nativeQuery=true)
	public List<OrderPlat> findOrderPlat(Integer pstatus,Integer status);
	
    public List<OrderPlat> findByPaystatus(Integer status);
	
	
	
}
